<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    const fruits = [
        {name: 'apple', color: 'red'},
        {name: 'banana', color: 'yellow'},
        {name: 'grape', color: 'purple'}
    ];

    function test() {
        // 条件：简短方式，所有的水果都必须是红色
        let isAllRed = fruits.some(f => f.color == 'red');
        console.log(isAllRed);
    }


    test(); //


</script>
</body>
</html>